<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

Route::group(['prefix' => 'v1','namespace' => 'v1'],function (){


    //登陆接口
    Route::get('login','LoginController@login');

//    获取tokend
    Route::get('getToken','LoginController@getToken');

//    点击收藏
    Route::get('SaveCollect','UserController@SaveCollect') -> middleware('is_token_exist');

    //    点击取消收藏
    Route::get('DeletedCollect','UserController@DeletedCollect') -> middleware('is_token_exist');

    //    是否已收藏
    Route::get('IsFocusCollect','UserController@IsFocusCollect') -> middleware('is_token_exist');

    /**
     * 首页
     */
    //获取帖子
//    Route::get('card/get','CardController@get')-> middleware('is_token_exist');
//    Route::get('card/getById','CardController@getById')-> middleware('is_token_exist');

//    获取首页全部数据
    Route::get('home/getALLHomeDate','CardController@getALLHomeDate');

    //    获取首页我的大学数据
    Route::get('home/getHomeMySchoolDate','CardController@getHomeMySchoolDate') -> middleware('is_token_exist');

    //    获取首页全我关注的大学
    Route::get('home/getHomeMyFocusSchoolDate','CardController@getHomeMyFocusSchoolDate')-> middleware('is_token_exist');

    //    获取首页最新数据
    Route::get('home/getHomeNewDate','CardController@getHomeNewDate');

//    获取首页最热数据
    Route::get('home/getHomeHotDate','CardController@getHomeHotDate');

    //获取分类
    Route::get('card_category/get','CardCategoryController@get');

    //获取所有大学
    Route::get('school/getALLSchool','SchoolController@getALLSchool')-> middleware('is_token_exist');

    //获取最新未读消息
   // Route::get('message/get','MessageController@get')-> middleware('is_token_exist');
    Route::get('message/getAll','MessageController@getAll');

    //获取所有消息通过用户id参数uuid和当前会话发送者id
    Route::get('message/getAllByUser','MessageController@getAllByUser')-> middleware('is_token_exist');

    //获取收藏
    Route::get('favorite/get','MyFavoriteController@get')-> middleware('is_token_exist');

    //获取我的发帖
    Route::get('card/getMyCard','CardController@getMyCard')-> middleware('is_token_exist');

    //我的点赞
    Route::get('card/getMyLike','CardController@getMyLike')-> middleware('is_token_exist');

    Route::get('getuid','UserController@getUid');
    Route::get('getHeadUrl','UserController@getAvarUrl');


    Route::get('getAlluid','UserController@getAllUid');

    Route::get('gettokens','UserController@test');

    //获取我的页面得关注数量
    Route::get('getFocusNum','UserController@getFocusNum') ->middleware('is_token_exist');
    //获取我的页面得粉丝数量
    Route::get('getFansNum','UserController@getFansNum') ->middleware('is_token_exist');
    //获取我的页面得超赞数量
    Route::get('getLikeNum','UserController@getLikeNum') ->middleware('is_token_exist');

//    查询别人的关注 粉丝 超赞数量
    Route::get('getFocusNumTo','UserController@getFocusNumTo');
    Route::get('getFansNumTo','UserController@getFansNumTo');
    Route::get('getLikeNumTo','UserController@getLikeNumTo');

    //获取我的页面得关注详细
    Route::get('getFocusNumDesc','UserController@getFocusNumDesc') ->middleware('is_token_exist');

    //获取我的页面得粉丝详细
    Route::get('getFansNumDesc','UserController@getFansNumDesc') ->middleware('is_token_exist');

//    获取用户信息
    Route::get('getUserInfo','UserController@getUserInfo') ->middleware('is_token_exist');

//    查询自己的发帖 评论 点赞 收藏（别人）
    Route::get('getMyDescAllOrToDate','UserController@getMyDescAllOrToDate') ->middleware('is_token_exist');


});


//用户
Route::group(['prefix' => 'v1/user','namespace' => 'v1'],function (){

    //用户
    Route::get('get','UserController@getUserInfo')-> middleware('is_token_exist');

    //查询是否关注这个用户
    Route::get('getIsFocus','UserController@getIsFocus') -> middleware('is_token_exist'); //focus_id
    //关注这个用户
    Route::get('SaveFocusUser','UserController@SaveFocusUser')-> middleware('is_token_exist');

    //取消关注这个用户
    Route::get('deleteFocusUser','UserController@deleteFocusUser')-> middleware('is_token_exist');

//    帖子点赞
    Route::get('SaveCardLike','UserController@SaveCardLike')-> middleware('is_token_exist');

    //    帖子取消点赞
    Route::get('DeletedCardLike','UserController@DeletedCardLike')-> middleware('is_token_exist');

    //帖子点赞数量
    Route::get('CardLikeNum','UserController@CardLikeNum');

    //获取帖子点赞用户头像
    Route::get('CardLikeUserImage','UserController@CardLikeUserImage');

//    添加浏览记录
    Route::post('SaveFlow','UserController@SaveFlow');

//    获取浏览记录
    Route::get('getFlow','UserController@getFlow');

});


//评论
Route::group(['prefix' => 'v1/comment','namespace' => 'v1'],function (){

    //查询评论数量
    Route::get('CommentAllNum','CommentController@CommentAllNum');//cid

    //获取帖子评论全部内容
    Route::get('CardCommentALLUser','CommentController@CardCommentALLUser');

    //获取帖子评论详细
    Route::get('CardCommentDesc','CommentController@CardCommentDesc');


    //获取帖子评论信息详细评论
    Route::get('CardCommentDescCommentDesc','CommentController@CardCommentDescCommentDesc') ->middleware('is_token_exist');

//    帖子评论
    Route::post('CardComment','CommentController@CardComment') ->middleware('is_token_exist');



});


//话题
Route::group(['prefix' => 'v1/topic','namespace' => 'v1'],function (){
//    查询话题分类数据
    Route::get('getTopicDate','TopicController@getTopicDate');//cardId

//    话题加入总计
    Route::get('getALLJoinDate','TopicController@getALLJoinDate');//topic_id

//    话题发帖总计
    Route::get('getSendPasteDate','TopicController@getSendPasteDate');

//    话题关注状态
    Route::get('getTopicFocusStatue','TopicController@getTopicFocusStatue') -> middleware('is_token_exist');//token topic_id

    //    关注话题
    Route::get('SaveFocusTopic','TopicController@SaveFocusTopic') ->middleware('is_token_exist'); //user_id topic_id

    //    取消关注话题
    Route::get('deletedFocusTopic','TopicController@deletedFocusTopic') ->middleware('is_token_exist'); //user_id topic_id

    //    话题对应内容(全部)
    Route::get('getTopicContentDate','TopicController@getTopicContentDate') -> middleware('is_token_exist'); // topic_id token

    //    话题对应内容(最新)
    Route::get('getTopicContentNewDate','TopicController@getTopicContentNewDate')-> middleware('is_token_exist'); // topic_id

    //    话题对应内容(最热)
    Route::get('getTopicContentHotDate','TopicController@getTopicContentHotDate') -> middleware('is_token_exist'); // topic_id

    //    话题内容详细
    Route::get('getTopicContentDesc','TopicController@getTopicContentDesc') -> middleware('is_token_exist'); // topic_id


});

//搜索接口
Route::group(['prefix' => 'v1/search','namespace' => 'v1'],function (){
    //    搜索学校
    Route::get('searchSchool','SchoolController@searchSchool') ->middleware('is_token_exist') ;
});

//学校相关接口
Route::group(['prefix' => 'v1/school','namespace' => 'v1'],function (){


    //统计学校发帖数量
    Route::get('schoolPostMsg','SchoolController@schoolPostMsg') ; //

    //统计学校关注数量
    Route::get('schoolFocusNum','SchoolController@schoolFocusNum') ; //

    //统计学校评论数量
    Route::get('schoolCommentNum','SchoolController@schoolCommentNum') ; //

    //统计学校浏览数量
    Route::get('schoolFlowNum','SchoolController@schoolFlowNum') -> middleware('is_token_exist'); //

//    学校详细(全部)
    Route::get('schoolDescALL','SchoolController@schoolDescALL') ->middleware('is_token_exist') ; //

    //    学校详细(最新)
    Route::get('schoolDescNew','SchoolController@schoolDescNew') ->middleware('is_token_exist') ; //

    //    学校详细(最热)
    Route::get('schoolDescHot','SchoolController@schoolDescHot') ->middleware('is_token_exist') ; //

    //    关注学校
    Route::get('SaveFocusSchool','SchoolController@SaveFocusSchool') -> middleware('is_token_exist');

    //    取消关注学校
    Route::get('DeletedFocusSchool','SchoolController@DeletedFocusSchool') -> middleware('is_token_exist');

});


//文件上传
Route::group(['prefix' => 'v1/upload','namespace' => 'v1'],function (){
    //    图片上传
    Route::post('imageUpload','QiniuController@store');

    //软件吐槽
    Route::post('suggest','QiniuController@suggest') -> middleware('is_token_exist');
    //保存软件吐槽图片
    Route::post('suggestImage','QiniuController@suggestImage');

    //学校添加
    Route::post('AddSchool','QiniuController@AddSchool')-> middleware('is_token_exist');

    //发帖
    Route::post('AddSendPaste','QiniuController@AddSendPaste')-> middleware('is_token_exist');

    //保存发帖图片
    Route::post('AddSendPasteImage','QiniuController@AddSendPasteImage')-> middleware('is_token_exist');

});

//审核专区
Route::group(['prefix' => 'v1/audit','namespace' => 'v1'],function () {
    //读取被举报的贴
    Route::get('getAuditCard', 'AuditController@getAuditCard')->middleware('is_token_exist');

    //删除被举报的贴
    Route::post('DeletedAuditCard', 'AuditController@DeletedAuditCard');

    //正常被举报的贴
    Route::post('AuditCard', 'AuditController@AuditCard');

//    举报帖子
    Route::post('reportCard', 'AuditController@reportCard')->middleware('is_token_exist');

//    鉴权(检查用户是否有管理员权限)
    Route::get('AAA', 'AuditController@AAA')->middleware('is_token_exist');

});
